package o;

import o.dnr.e;

public class dny {
    private e ˏ;

    public static class a {
        private String ˎ;
        private int ˏ;
        private String ॱ;

        public a(int i, String str, String str2) {
            this.ˏ = i;
            this.ˎ = str;
            this.ॱ = str2;
        }

        public String toString() {
            return "CommandResult [result=" + this.ˏ + ", successMsg=" + this.ˎ + ", errorMsg=" + this.ॱ + "]";
        }

        public String ˋ() {
            return this.ˎ;
        }

        public String ˎ() {
            return this.ॱ;
        }
    }

    public dny(e eVar) {
        this.ˏ = eVar;
    }

    public a ˏ(String str) {
        return ॱ(new String[]{str});
    }

    /* JADX WARNING: inconsistent code. */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    private o.dny.a ॱ(java.lang.String[] r15) {
        /*
        r14 = this;
        r2 = 0;
        r3 = -1;
        if (r15 == 0) goto L_0x0007;
    L_0x0004:
        r0 = r15.length;
        if (r0 != 0) goto L_0x0014;
    L_0x0007:
        r0 = "DiagnoseUtil";
        r1 = "commands is null or length is 0";
        o.dna.ˋ(r0, r1);
        r0 = new o.dny$a;
        r0.<init>(r3, r2, r2);
    L_0x0013:
        return r0;
    L_0x0014:
        r8 = java.lang.System.nanoTime();
        r10 = new java.lang.StringBuilder;
        r0 = "";
        r10.<init>(r0);
        r0 = java.lang.Runtime.getRuntime();	 Catch:{ IOException -> 0x0187, Exception -> 0x016c, all -> 0x0148 }
        r1 = "sh";
        r6 = r0.exec(r1);	 Catch:{ IOException -> 0x0187, Exception -> 0x016c, all -> 0x0148 }
        r1 = new java.io.DataOutputStream;	 Catch:{ IOException -> 0x018f, Exception -> 0x0173, all -> 0x015b }
        r0 = r6.getOutputStream();	 Catch:{ IOException -> 0x018f, Exception -> 0x0173, all -> 0x015b }
        r1.<init>(r0);	 Catch:{ IOException -> 0x018f, Exception -> 0x0173, all -> 0x015b }
        r4 = r15.length;	 Catch:{ IOException -> 0x004f, Exception -> 0x0179, all -> 0x015f }
        r0 = 0;
    L_0x0034:
        if (r0 >= r4) goto L_0x00a6;
    L_0x0036:
        r5 = r15[r0];	 Catch:{ IOException -> 0x004f, Exception -> 0x0179, all -> 0x015f }
        if (r5 != 0) goto L_0x003d;
    L_0x003a:
        r0 = r0 + 1;
        goto L_0x0034;
    L_0x003d:
        r7 = "UTF-8";
        r5 = r5.getBytes(r7);	 Catch:{ IOException -> 0x004f, Exception -> 0x0179, all -> 0x015f }
        r1.write(r5);	 Catch:{ IOException -> 0x004f, Exception -> 0x0179, all -> 0x015f }
        r5 = "\n";
        r1.writeBytes(r5);	 Catch:{ IOException -> 0x004f, Exception -> 0x0179, all -> 0x015f }
        r1.flush();	 Catch:{ IOException -> 0x004f, Exception -> 0x0179, all -> 0x015f }
        goto L_0x003a;
    L_0x004f:
        r0 = move-exception;
        r4 = r2;
        r5 = r6;
        r6 = r3;
        r3 = r2;
    L_0x0054:
        r7 = "DiagnoseUtil";
        r8 = new java.lang.StringBuilder;	 Catch:{ all -> 0x0167 }
        r8.<init>();	 Catch:{ all -> 0x0167 }
        r9 = " beging to silent process IOException :";
        r8 = r8.append(r9);	 Catch:{ all -> 0x0167 }
        r0 = r0.toString();	 Catch:{ all -> 0x0167 }
        r0 = r8.append(r0);	 Catch:{ all -> 0x0167 }
        r0 = r0.toString();	 Catch:{ all -> 0x0167 }
        o.dna.ˋ(r7, r0);	 Catch:{ all -> 0x0167 }
        o.dnw.ˎ(r1);
        o.dnw.ˎ(r4);
        o.dnw.ˎ(r3);
        if (r5 == 0) goto L_0x01b3;
    L_0x007b:
        r5.destroy();
        r0 = r2;
        r7 = r6;
    L_0x0080:
        if (r0 != 0) goto L_0x0089;
    L_0x0082:
        r0 = new java.lang.StringBuilder;
        r1 = "";
        r0.<init>(r1);
    L_0x0089:
        r1 = r14.ˏ;
        if (r1 == 0) goto L_0x0096;
    L_0x008d:
        r1 = r14.ˏ;
        r2 = r10.toString();
        r1.ˏ(r2);
    L_0x0096:
        r1 = new o.dny$a;
        r2 = r10.toString();
        r0 = r0.toString();
        r1.<init>(r7, r2, r0);
        r0 = r1;
        goto L_0x0013;
    L_0x00a6:
        r0 = "exit\n";
        r1.writeBytes(r0);	 Catch:{ IOException -> 0x004f, Exception -> 0x0179, all -> 0x015f }
        r1.flush();	 Catch:{ IOException -> 0x004f, Exception -> 0x0179, all -> 0x015f }
        r7 = r6.waitFor();	 Catch:{ IOException -> 0x004f, Exception -> 0x0179, all -> 0x015f }
        r3 = new java.lang.StringBuilder;	 Catch:{ IOException -> 0x0197, Exception -> 0x017e, all -> 0x015f }
        r3.<init>();	 Catch:{ IOException -> 0x0197, Exception -> 0x017e, all -> 0x015f }
        r5 = new java.io.BufferedReader;	 Catch:{ IOException -> 0x019e, Exception -> 0x0182, all -> 0x015f }
        r0 = new java.io.InputStreamReader;	 Catch:{ IOException -> 0x019e, Exception -> 0x0182, all -> 0x015f }
        r4 = r6.getInputStream();	 Catch:{ IOException -> 0x019e, Exception -> 0x0182, all -> 0x015f }
        r11 = "UTF-8";
        r0.<init>(r4, r11);	 Catch:{ IOException -> 0x019e, Exception -> 0x0182, all -> 0x015f }
        r5.<init>(r0);	 Catch:{ IOException -> 0x019e, Exception -> 0x0182, all -> 0x015f }
        r4 = new java.io.BufferedReader;	 Catch:{ IOException -> 0x01a7, Exception -> 0x0185 }
        r0 = new java.io.InputStreamReader;	 Catch:{ IOException -> 0x01a7, Exception -> 0x0185 }
        r11 = r6.getErrorStream();	 Catch:{ IOException -> 0x01a7, Exception -> 0x0185 }
        r12 = "UTF-8";
        r0.<init>(r11, r12);	 Catch:{ IOException -> 0x01a7, Exception -> 0x0185 }
        r4.<init>(r0);	 Catch:{ IOException -> 0x01a7, Exception -> 0x0185 }
    L_0x00d7:
        r0 = r5.readLine();	 Catch:{ IOException -> 0x00f0, Exception -> 0x0108, all -> 0x0164 }
        if (r0 == 0) goto L_0x00f8;
    L_0x00dd:
        r2 = r10.append(r0);	 Catch:{ IOException -> 0x00f0, Exception -> 0x0108, all -> 0x0164 }
        r11 = "\n";
        r2.append(r11);	 Catch:{ IOException -> 0x00f0, Exception -> 0x0108, all -> 0x0164 }
        r2 = r14.ˏ;	 Catch:{ IOException -> 0x00f0, Exception -> 0x0108, all -> 0x0164 }
        if (r2 == 0) goto L_0x00d7;
    L_0x00ea:
        r2 = r14.ˏ;	 Catch:{ IOException -> 0x00f0, Exception -> 0x0108, all -> 0x0164 }
        r2.ॱ(r0, r8);	 Catch:{ IOException -> 0x00f0, Exception -> 0x0108, all -> 0x0164 }
        goto L_0x00d7;
    L_0x00f0:
        r0 = move-exception;
        r2 = r3;
        r3 = r4;
        r4 = r5;
        r5 = r6;
        r6 = r7;
        goto L_0x0054;
    L_0x00f8:
        r0 = r4.readLine();	 Catch:{ IOException -> 0x00f0, Exception -> 0x0108, all -> 0x0164 }
        if (r0 == 0) goto L_0x0137;
    L_0x00fe:
        r0 = r3.append(r0);	 Catch:{ IOException -> 0x00f0, Exception -> 0x0108, all -> 0x0164 }
        r2 = "\n";
        r0.append(r2);	 Catch:{ IOException -> 0x00f0, Exception -> 0x0108, all -> 0x0164 }
        goto L_0x00f8;
    L_0x0108:
        r0 = move-exception;
        r2 = r4;
    L_0x010a:
        r4 = "DiagnoseUtil";
        r8 = new java.lang.StringBuilder;	 Catch:{ all -> 0x0162 }
        r8.<init>();	 Catch:{ all -> 0x0162 }
        r9 = " beging to silent process Exception :";
        r8 = r8.append(r9);	 Catch:{ all -> 0x0162 }
        r0 = r0.toString();	 Catch:{ all -> 0x0162 }
        r0 = r8.append(r0);	 Catch:{ all -> 0x0162 }
        r0 = r0.toString();	 Catch:{ all -> 0x0162 }
        o.dna.ˋ(r4, r0);	 Catch:{ all -> 0x0162 }
        o.dnw.ˎ(r1);
        o.dnw.ˎ(r5);
        o.dnw.ˎ(r2);
        if (r6 == 0) goto L_0x01b0;
    L_0x0131:
        r6.destroy();
        r0 = r3;
        goto L_0x0080;
    L_0x0137:
        o.dnw.ˎ(r1);
        o.dnw.ˎ(r5);
        o.dnw.ˎ(r4);
        if (r6 == 0) goto L_0x01b0;
    L_0x0142:
        r6.destroy();
        r0 = r3;
        goto L_0x0080;
    L_0x0148:
        r0 = move-exception;
        r1 = r2;
        r5 = r2;
        r6 = r2;
    L_0x014c:
        o.dnw.ˎ(r1);
        o.dnw.ˎ(r5);
        o.dnw.ˎ(r2);
        if (r6 == 0) goto L_0x015a;
    L_0x0157:
        r6.destroy();
    L_0x015a:
        throw r0;
    L_0x015b:
        r0 = move-exception;
        r1 = r2;
        r5 = r2;
        goto L_0x014c;
    L_0x015f:
        r0 = move-exception;
        r5 = r2;
        goto L_0x014c;
    L_0x0162:
        r0 = move-exception;
        goto L_0x014c;
    L_0x0164:
        r0 = move-exception;
        r2 = r4;
        goto L_0x014c;
    L_0x0167:
        r0 = move-exception;
        r2 = r3;
        r6 = r5;
        r5 = r4;
        goto L_0x014c;
    L_0x016c:
        r0 = move-exception;
        r1 = r2;
        r5 = r2;
        r6 = r2;
        r7 = r3;
        r3 = r2;
        goto L_0x010a;
    L_0x0173:
        r0 = move-exception;
        r1 = r2;
        r5 = r2;
        r7 = r3;
        r3 = r2;
        goto L_0x010a;
    L_0x0179:
        r0 = move-exception;
        r5 = r2;
        r7 = r3;
        r3 = r2;
        goto L_0x010a;
    L_0x017e:
        r0 = move-exception;
        r3 = r2;
        r5 = r2;
        goto L_0x010a;
    L_0x0182:
        r0 = move-exception;
        r5 = r2;
        goto L_0x010a;
    L_0x0185:
        r0 = move-exception;
        goto L_0x010a;
    L_0x0187:
        r0 = move-exception;
        r1 = r2;
        r4 = r2;
        r5 = r2;
        r6 = r3;
        r3 = r2;
        goto L_0x0054;
    L_0x018f:
        r0 = move-exception;
        r1 = r2;
        r4 = r2;
        r5 = r6;
        r6 = r3;
        r3 = r2;
        goto L_0x0054;
    L_0x0197:
        r0 = move-exception;
        r3 = r2;
        r4 = r2;
        r5 = r6;
        r6 = r7;
        goto L_0x0054;
    L_0x019e:
        r0 = move-exception;
        r4 = r2;
        r5 = r6;
        r6 = r7;
        r13 = r2;
        r2 = r3;
        r3 = r13;
        goto L_0x0054;
    L_0x01a7:
        r0 = move-exception;
        r4 = r5;
        r5 = r6;
        r6 = r7;
        r13 = r2;
        r2 = r3;
        r3 = r13;
        goto L_0x0054;
    L_0x01b0:
        r0 = r3;
        goto L_0x0080;
    L_0x01b3:
        r0 = r2;
        r7 = r6;
        goto L_0x0080;
        */
        throw new UnsupportedOperationException("Method not decompiled: o.dny.ॱ(java.lang.String[]):o.dny$a");
    }
}
